#include "Dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    time(&startTime);
    int fd;
    char *path = "FIFO.tmp";
    mkfifo(path, O_CREAT|O_RDWR);
    fd = open(path, O_WRONLY, 0);
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(printFiles()));
    ui->setupUi(this);
}

Dialog::~Dialog()
{
    close(fd);
    delete ui;
}

void Dialog::printFiles()
{
    QDir dir("/etc");
    ui->centralWidget
//    emit Dialog::printing();
}

void Dialog::IPC(int fd, time_t i)
{
//    int fd;
//    mkfifo(path, O_CREAT|O_RDWR);
//    fd = open(path, O_WRONLY, 0);
    write(fd, &i, sizeof(time_t));
//    close(fd);
}
